package me.zk.practice1.hw;

import java.util.*;

public class HWBJ44 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] nums = Arrays.stream(scanner.nextLine().split(",")).mapToInt(Integer::parseInt).toArray();

        Map<Integer,Integer> map = new HashMap<>();
        for (int num : nums) {
            map.put(num,map.getOrDefault(num,0)+1);
        }
        PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> b[1] - a[1]);
        for (int key : map.keySet()) {
            pq.add(new int[]{key, map.get(key)});
        }
        int val = nums.length, count = 0;
        while (val > nums.length / 2) {
            val -= pq.poll()[1];
            count++;
        }
        System.out.println(count);

    }
}
